home *** CD-ROM | disk | FTP | other *** search
- Path: labhp33.cs.utah.edu!stack
- From: stack@labhp33.cs.utah.edu (Timothy Stack)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: Boopsi
- Date: 5 Mar 1996 15:54:36 GMT
- Organization: University of Utah Computer Center
- Message-ID: <4hho3s$snt@news.cc.utah.edu>
- References: <3425.6632T1029T1644@cycor.ca>
- NNTP-Posting-Host: labhp33.cs.utah.edu
- X-Newsreader: TIN [version 1.2 PL2]
-
- gcaine (gcaine@cycor.ca) wrote:
- : What's the trick to getting a frame around boopsi gadgets?
-
- : I tried the example in the RKM libraries book, and the string gadget
- : has no border. I then tried a frbuttonclass gadget, with text. I passed
- : it the DrawInfo with the GA_DrawInfo tag, and I get the text, but that's
- : all.
-
- : Here's a test program to show what I mean.
-
- : ----------------------------------Cut---------------------------------
-
- : #include <exec/types.h>
- : #include <utility/tagitem.h>
- : #include <intuition/intuition.h>
- : #include <intuition/gadgetclass.h>
-
- : #include <proto/exec.h>
- : #include <proto/intuition.h>
-
- : struct Window *w;
- : struct IntuiMessage *msg;
- : struct Gadget *testGad;
-
-
-
- : #define TESTGAD_ID 1L
- : #define MINWINDOWWIDTH 80
- : #define MINWINDOWHEIGHT 70
-
- : void main(void)
- : {
- : BOOL done = FALSE;
- : struct DrawInfo *drawInfo = NULL;
- : struct Screen *pubScn = NULL;
-
- :
- : if (IntuitionBase = (struct IntuitionBase *)OpenLibrary("intuition.library", 37L))
- : {
- : if (pubScn = LockPubScreen(NULL))
- : {
- : if (drawInfo = GetScreenDrawInfo(pubScn))
- : {
-
- : if (w = OpenWindowTags(NULL,
- : WA_Flags, WFLG_DEPTHGADGET | WFLG_DRAGBAR |
- : WFLG_CLOSEGADGET | WFLG_SIZEGADGET,
- : WA_IDCMP, IDCMP_CLOSEWINDOW | IDCMP_GADGETUP,
- : WA_MinWidth, MINWINDOWWIDTH,
- : WA_MinHeight, MINWINDOWHEIGHT,
- : TAG_END))
- : {
- : if (testGad = (struct Gadget *)NewObject(NULL,
- : "frbuttonclass",
- : GA_ID, TESTGAD_ID,
- : GA_Top, (w->BorderTop) + 10L,
- : GA_Left, (w->BorderLeft) + 5L,
- : GA_Width, 25,
- : GA_Height, 12,
- : GA_DrawInfo, drawInfo,
- : GA_Text, (ULONG)"Test",
- : TAG_END))
-
- : {
- :
- : AddGList(w, testGad, -1, -1, NULL);
- : RefreshGList(testGad, w, NULL, -1);
- :
- : while (done == FALSE)
- : {
- : WaitPort((struct MsgPort *)w->UserPort);
- : while (msg = (struct IntuiMessage *)
- : GetMsg((struct MsgPort *)w->UserPort))
- : {
- : if (msg->Class == IDCMP_CLOSEWINDOW)
- : done = TRUE;
- : ReplyMsg((struct Message *)msg);
- : }
- : }
- : RemoveGList(w, testGad, -1);
- : DisposeObject(testGad);
- : }
- : CloseWindow(w);
- : }
- : FreeScreenDrawInfo(pubScn, drawInfo);
- : drawInfo = NULL;
- : }
- :
- : UnlockPubScreen(NULL, pubScn);
- : pubScn = NULL;
- : }
- : CloseLibrary((struct Library *)IntuitionBase);
- : }
- : }
- : --------------------------------End Cut-------------------------------
-
- : I've just started playing with boopsi now, but I could use some help.
-
- : Does anyone know where I can get some more documentation, or tutorials?
-
- : Gary Caine Member: Team AMIGA
-
- First of all, RTFM. You need to provide the frame for frbutton. So
- create a frameiclass object and pass it to your frbutton through
- GA_Image or GA_LabelImage i cant remember.
-
- So i think works like this...
-
- myframe = NewObject( NULL, "frameiclass",
- IA_Left, 0,
- IA_Top, 0,
- IA_Height, height,
- IA_Width, width,
- IA_EdgesOnly, TRUE,
- TAG_DONE )
- button = NewObject( NULL, "frbuttonclass",
- GA_Left, left,
- GA_Top, top,
- GA_Width, width,
- GA_Height, height,
- GA_Image, myframe,
- GA_Text, "Text",
- TAG_DONE )
-